package com.common.tag;

import java.io.IOException;
import java.util.Collection;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;

public class ListSizeMapping extends BaseTag {


	
	private Object items;
	
	private int suff=0;
	

	
	public int getSuff() {
		return suff;
	}




	public void setSuff(int suff) {
		this.suff = suff;
	}




	public Object getItems() {
		return items;
	}




	public void setItems(Object items) {
		this.items = items;
	}




	@Override
	public int doStartTag() throws JspException {
		JspWriter out = pageContext.getOut();
		StringBuilder outStr = new StringBuilder("");
		
		Collection c = (Collection) items;
		
		if(c!=null){
			outStr.append(c.size()+suff);
		
		try {
			out.write(outStr.toString());
		} catch (IOException e) {
			log.error(e.getMessage());
		}
		}
		return SKIP_PAGE;
	}
	
}
